<template>
  <div class="OperateBtn-wrap">
    <el-tooltip
      v-for="(item, index) in operateList"
      :key="index"
      class="item"
      effect="dark"
      :content="item.label"
      placement="bottom"
    >
      <i :class="`${item.icon}`" @click="operateClick(item.name)"></i>
    </el-tooltip>
  </div>
</template>

<script lang="ts" setup>
import { defineProps, defineEmits, ref } from 'vue';
const props = defineProps({
  item: {
    type: Object,
    default: () => {
      return {};
    },
  },
});
const emit = defineEmits(['operateClick']);
const operateList = ref([
  {
    name: 'url',
    label: '访问',
    icon: 'vul-icon-url',
  },
]);

const operateClick = (type) => {
  emit('operateClick', type, props.item);
};
</script>

<style lang="scss" scoped>
.OperateBtn-wrap {
  // margin-left: 18px;
  // margin-right: 28px;
  i {
    font-size: 20px;
    cursor: pointer;
    margin-right: 8px;
  }

  .vul-refresh {
    color: #0289f7;
  }
}
</style>
